﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin_AddAdmin.aspx.cs" Inherits="Master_Admin_AddAdmin" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="Css/Css.css" rel="stylesheet" type="text/css" />
    <script src="../Script/popup.js"></script>
    <link href="Css/Css.css" rel="stylesheet" type="text/css" />
    <link href="../Css/ColorPicker.css" rel="stylesheet" type="text/css" />   
    <link href="../Script/formValidator/style/validator.css" rel="stylesheet" type="text/css" />
    <script src="../Script/jquery.js" type="text/javascript"></script>
    <script src="../Script/ColorPicker.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../Css/Users.css" />
    <link href="../Script/formValidator/style/validator.css" rel="stylesheet" type="text/css" />
    <script src="../Script/formValidator/jquery_last.js" type="text/javascript"></script>
    <script src="../Script/formValidator/formValidator.js" type="text/javascript"></script>
    <script src="../Script/formValidator/formValidatorRegex.js" type="text/javascript"></script>
    <script src="../Script/province.aspx"></script>
    <script type="text/javascript">
        $(document).ready(function() {
        $.formValidator.initConfig({ alertmessage: false, formid: "Form1", onerror: function(msg) { alert(msg) } });
        $("#txtAgentName").formValidator({ tipid: "txtTipAgentName", onshow: "请输入代理商名称", onfocus: "代理商名称不能为空", oncorrect: "输入正确" }).inputValidator({ min: 1, max: 25, empty: { leftempty: false, rightempty: false, emptyerror: "代理商名称两边不能有空符号" }, onerror: "代理商名称长度必须在1-25位,请确认" });
        //$("#txtPwd").formValidator({ tipid: "txtTipPwd", onshow: "请输入代理商密码", onfocus: "代理商密码不能为空", oncorrect: "输入正确" }).inputValidator({  min: 1, max: 25, empty: { leftempty: false, rightempty: false, emptyerror: "代理商密码两边不能有空符号" }, onerror: "代理商密码不能为空,请确认" });
        //$("#txtPwdAgain").formValidator({ tipid: "txtTipPwdAgain", onshow: "请输入确认密码", onfocus: "确认密码不能为空", oncorrect: "输入正确" }).inputValidator({  min: 1, max: 25, empty: { leftempty: false, rightempty: false, emptyerror: "确认密码两边不能有空符号" }, onerror: "确认密码不能为空,请确认" });
        $("#txtTrueName").formValidator({ tipid: "txtTipTrueName", onshow: "请输入真实姓名", onfocus: "真实姓名不能为空", oncorrect: "输入正确" }).inputValidator({  min: 1, max: 25, empty: { leftempty: false, rightempty: false, emptyerror: "真实姓名两边不能有空符号" }, onerror: "真实姓名不能为空,请确认" });
        $("#txtEmail").formValidator({ tipid: "txtTipEmail", onshow: "请输入邮箱", onfocus: "邮箱不能为空", oncorrect: "输入正确" }).inputValidator({  min: 1, max: 30, empty: { leftempty: false, rightempty: false, emptyerror: "邮箱两边不能有空符号" }, onerror: "邮箱不能为空,请确认" });
        $("#txtAddress").formValidator({ tipid: "txtTipAddress", onshow: "请输入地址", onfocus: "地址不能为空", oncorrect: "输入正确" }).inputValidator({  min: 1, max: 25, empty: { leftempty: false, rightempty: false, emptyerror: "地址两边不能有空符号" }, onerror: "地址不能为空,请确认" });
        $("#txtTel").formValidator({ tipid: "txtTitleTel", onshow: "请输入联系电话", onfocus: "联系电话不能为空", oncorrect: "输入正确" }).inputValidator({  min: 1, max: 25, empty: { leftempty: false, rightempty: false, emptyerror: "联系电话两边不能有空符号" }, onerror: "联系电话不能为空,请确认" });
        });
    </script>
    <script type="text/javascript">
        function MusicTypeChange(va)
        {
            var btnMusicType=document.getElementById("btnMusicType");
            switch(va)
            {
                case "0":
                btnMusicType.style.display="block";
                break;
                case "1":
                btnMusicType.style.display="none";
                break;
            }
        }
        function checkData()
        {
            var pwd=$("#txtPwd").val();
            var pwdAgain=$("#txtPwdAgain").val();
            if("<%=this.id %>"=="0")
            {
                 if(pwd==""||pwdAgain=="")
                 {
                    alert("密码不能为空");
                    return false;
                 }
            }
            
        
            var province=$("#selProvice").val();
            var city=$("#selCity").val();
            if(province==0||city==0)
            {
                alert("您还没有选择分站地区！");
                return false;
            }
            
            if(pwd!=pwdAgain)
            {
                alert('密码两次输入不一致！');
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
    <form id="Form1" runat="server">
    <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align="center">
        <tr>
            <td colspan="2" align="center" class="title">
                <strong><asp:Label ID="lblTitle" Text="添加代理商" runat="server" /></strong>
            </td>
        </tr>
        <tr class="tdbg">
            <td width="70" height="30">
                <strong>管理导航：</strong>
            </td>
            <td height="30">
                <a href="Admin_AddAgent.aspx">添加代理商</a>&nbsp;|&nbsp;<a href="Admin_ManageAgent.aspx">代理商管理</a>
            </td>
        </tr>
    </table>
      
    <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align=center>
            <tr>
                <td colspan="2" align="center" class="title">
                    <strong>
                        <asp:Label ID="lblTitle1" Text="添加代理商" runat="server" /></strong>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>代理商名称：</strong>
                </td>
                <td height="25">
                    <asp:TextBox runat="server" ID="txtAgentName" /><div id="txtTipAgentName"></div>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>代理商密码：</strong>
                </td>
                <td height="25">
                    <asp:TextBox runat="server" TextMode="Password" ID="txtPwd" /><asp:Label ID="lblTip1" Visible="false" runat="server" Text="不修改密码保留空" /><div id="txtTipPwd"></div>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>密码确认：</strong>
                </td>
                <td height="25">
                    <asp:TextBox runat="server" TextMode="Password" ID="txtPwdAgain" /><asp:Label ID="lblTip" Visible="false" runat="server" Text="不修改密码保留空" /><div id="txtTipPwdAgain"></div>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>真实姓名：</strong>
                </td>
                <td height="25">
                    <asp:TextBox runat="server" ID="txtTrueName" /><div id="txtTipTrueName"></div>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>公司：</strong>
                </td>
                <td height="25">
                    <asp:TextBox runat="server" ID="txtCompany" /><div id="Div4"></div>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>邮箱：</strong>
                </td>
                <td height="25">
                    <asp:TextBox runat="server" ID="txtEmail" /><div id="txtTipEmail"></div>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>地址：</strong>
                </td>
                <td height="25">
                    <asp:TextBox runat="server" ID="txtAddress" /><div id="txtTipAddress"></div>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>联系电话：</strong>
                </td>
                <td height="25">
                    <asp:TextBox runat="server" ID="txtTel" /><div id="txtTitleTel"></div>
                </td>
            </tr>
            <tr class="tdbg">
                <td width="300" height="25" valign="middle">
                    <strong>分站地区：</strong>
                </td>
                <td height="25">
                    <select id="selProvice" name="selProvice" onChange="changeProvince(document.getElementById('selProvice'),document.getElementById('selCity'));">
                    </select>
                    <select id="selCity" name="selCity">
                    </select>
                    <script language="javascript" type="text/javascript">
                        initialize(document.getElementById('selProvice'), document.getElementById('selCity'), "<%=this.agentModel.LoginPro %>", "<%=this.agentModel.LoginCity %>");
                    </script> 
                    <div id="Div8"></div>
                </td>
            </tr>
            
            <tr class="tdbg">
                <td height="40" colspan="2" align="center">
                    <input name="Action" type="hidden" id="Action" value="SaveModify">
                    <asp:Button  ID="btnSubmit" runat="server" 
                        Style="cursor: hand; background-color: #cccccc; height: 20px;" 
                        Text="  确     定  " OnClientClick="return checkData();" onclick="btnSubmit_Click" />&nbsp;
                       <asp:Button  ID="Button1" runat="server" 
                        Style="cursor: hand; background-color: #cccccc; height: 20px;" 
                        Text="  修     改  " OnClientClick="return checkData();" Visible="false" onclick="Button1_Click" />
                    
                    
                    
                </td>
            </tr>
        </table>  
    </form>
</body>
</html>

